﻿@page
@{ Layout = "_Layout"; }
@section Styles{
  <style>
    .el-upload, .el-upload-dragger {
        width: 180px;
    }

        .cover {
            height: 180px;
            display: block;
        }
    .el-button-group .el-dropdown {
      float: left;
      margin-top: -2.5px;
      margin-right: -1px;
    }
  </style>
}

<el-card>
    <div slot="header" class="clearfix">
        <span>修改资料</span>
        <el-button style="float: right;padding:3px 0;" type="text" v-on:click="utils.closeLayerSelf"><i class="el-icon-close"></i></el-button>
    </div>
    <el-scrollbar class="scrollbar" :style="{ height: ($(window).innerHeight()-180) + 'px' }">
        <div style="margin-right:18px;">
            <el-form v-on:submit.native.prevent ref="form" :model="form" :size="euiSize" status-icon label-width="140px">
                <el-form-item label="资料名称" prop="name" :rules="[{ required: true, message: '请输入资料名称' }]">
                    <el-input v-model="form.name"></el-input>
                </el-form-item>
                <el-form-item label="封面">
                    <el-upload :action="uploadUrl"
                               :show-file-list="false"
                               :headers="{Authorization: 'Bearer ' + $token}"
                               list-type="picture-card"
                               :before-upload="uploadBefore"
                               :on-progress="uploadProgress"
                               :on-success="uploadSuccess"
                               :on-error="uploadError"
                               :on-remove="uploadRemove"
                               :multiple="false">
                        <img v-if="form.coverImgUrl" :src="form.coverImgUrl" class="cover">
                        <i v-else class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>
            </el-form>
        </div>
    </el-scrollbar>
</el-card>
<el-row align="center" style="margin-top:18px;">
    <el-col :span="24" align="center">
        <el-button icon="el-icon-check" type="primary" v-on:click="btnSubmitClick" :size="euiSize">确 定</el-button>
        <el-button icon="el-icon-close" :size="euiSize" v-on:click="utils.closeLayerSelf">取 消</el-button>
    </el-col>
</el-row>
@section Scripts{
<script src="/sitefiles/assets/js/admin/knowledges/knowledgesEdit.js" type="text/javascript"></script> }